package com.gupaoedu.vip;

import java.lang.reflect.Proxy;

/**
 * <p>
 *
 * </p>
 *
 * @author Nicky
 * @since 2019-10-05
 */
public class RpcProxyClient {

  public <T> T clientProxy(final Class<T> interfaceClass,final String host,
                           final int port){
    return (T) Proxy.newProxyInstance(interfaceClass.getClassLoader(),new Class<?>[]{interfaceClass},
    new RemotInvoktionHandler(host,port));
  }
}
